package com.bigdata.service.controller.app;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.bigdata.common.annotation.Log;
import com.bigdata.common.annotation.RepeatSubmit;
import com.bigdata.common.core.controller.BaseController;
import com.bigdata.common.core.domain.PageQuery;
import com.bigdata.common.core.domain.R;
import com.bigdata.common.core.page.TableDataInfo;
import com.bigdata.common.core.validate.AddGroup;
import com.bigdata.common.core.validate.EditGroup;
import com.bigdata.common.enums.BusinessType;
import com.bigdata.common.utils.poi.ExcelUtil;
import com.bigdata.service.domain.bo.DataPagesBo;
import com.bigdata.service.domain.vo.DataPagesVo;
import com.bigdata.service.service.IDataPagesService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 关于我们
 *
 * @author ruoyi
 * @date 2025-09-04
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/service/dataPages")
public class AppDataPagesController extends BaseController {

    private final IDataPagesService iDataPagesService;


    /**
     * 获取关于我们平台详细信息
     *
     * @param id 主键
     */
    @SaIgnore
    @GetMapping("/platform")
    public R<DataPagesVo> getInfo() {
        DataPagesBo pagesBo = new DataPagesBo();
        pagesBo.setMenuItemId(1L);
        List<DataPagesVo> list = iDataPagesService.queryList(pagesBo);
        if (CollectionUtils.isNotEmpty(list)) {
            return R.ok(list.get(0));
        }
        DataPagesVo dataPagesVo = new DataPagesVo();
        dataPagesVo.setContent("暂无数据");
        return R.ok(dataPagesVo);
    }

    @SaIgnore
    @GetMapping("/contact")
    public R<DataPagesVo> contact() {
        DataPagesBo pagesBo = new DataPagesBo();
        pagesBo.setMenuItemId(2L);
        List<DataPagesVo> list = iDataPagesService.queryList(pagesBo);
        if (CollectionUtils.isNotEmpty(list)) {
            return R.ok(list.get(0));
        }
        DataPagesVo dataPagesVo = new DataPagesVo();
        dataPagesVo.setContent("暂无数据");
        return R.ok(dataPagesVo);
    }

    @SaIgnore
    @GetMapping("/copyright")
    public R<DataPagesVo> Copyright() {
        DataPagesBo pagesBo = new DataPagesBo();
        pagesBo.setMenuItemId(3L);
        List<DataPagesVo> list = iDataPagesService.queryList(pagesBo);
        if (CollectionUtils.isNotEmpty(list)) {
            return R.ok(list.get(0));
        }
        DataPagesVo dataPagesVo = new DataPagesVo();
        dataPagesVo.setContent("暂无数据");
        return R.ok(dataPagesVo);
    }

}
